<cfparam name="newusername" default="">
<cfparam name="fullname" default="">
<cfparam name="userlevel" default="2">
<cfparam name="emailaddress" default="">
<cfparam name="userid" default="0">
<cfset showform = 1>

<cfif isdefined('form.newusername')>
	<cfinclude template = "../act/add.cfm">
</cfif>

<cfinvoke component="cfcs.common.settings" method="getusergroups" returnvariable="qgroups"></cfinvoke>
<cfif showform IS 1>
<cfoutput>
<form name="form1" method="post" action="index.cfm?c=cpusers&a=new">
  <table width="650" border="0" cellspacing="0" cellpadding="4">
    <tr>
    	<td id="columnheaders" colspan="2">New Admin</td>
    </tr>
    <tr> 
      <td width="120">Username:</td>
      <td width="41%"><input name="newusername" type="text" id="newusername" value="#newusername#" required="yes"></td>
    </tr>
    <tr>
      <td>Password: </td>
      <td><input name="newpassword" type="password" id="newpassword" required="yes"></td>
    </tr>
    <tr>
      <td>Retype Password:</td>
      <td><input name="newpassword_confirm" type="password" id="newpassword_confirm" required="yes" /></td>
    </tr>
    <tr>
      <td>Name:</td>
      <td><input name="fullname" type="text" id="fullname" value="#fullname#" required="yes" /></td>
    </tr>
    <tr>
      <td>Email Address:</td>
      <td><input name="emailaddress" type="text" id="emailaddress" value="#emailaddress#" required="yes" /></td>
    </tr>
    <tr> 
      <td>User Level:</td>
      <td><select name="userlevel" id="userlevel">
          <cfloop query="qgroups">
          <option <cfif userlevel IS qgroups.id>selected="selected"</cfif> value="#qgroups.id#">#qgroups.groupname#</option>
          </cfloop>
        </select></td>
    </tr>
        
    <tr> 
      <td colspan="2"><div align="center"> 
          <input type="submit" name="Submit" id="abutton" value="Add CP User">
        </div></td>
    </tr>
  </table>
  <p>&nbsp;</p>
</form>
</cfoutput>
</cfif>